package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author stone
 * @date 2022/04/29 15:14
 */
@RequestMapping("header")
@Controller
public class HeaderLimitController {

    //@RequestMapping(value = "limit",headers = {"aaa"})//一定要包含aaa这个请求头
    @RequestMapping(value = "limit",headers = {"aaa","bbb"})//一定要包含aaa和bbb这个请求头
    @ResponseBody
    public String headerLimit() {
        return "header limit";
    }

    //如果没有Accept这个请求头可以，如果要有的话，值一定是aaa/bbb
    @RequestMapping(value = "accept", produces = "aaa/bbb")
    @ResponseBody
    public String accept() {
        return "accept";
    }

    //Content-Type请求头的值，默认构造的请求不包含Content-Type这个请求头，所以一定要携带
    @RequestMapping(value = "contenttype", consumes = "ccc/ddd")
    @ResponseBody
    public String contenttype() {
        return "contenttype";
    }
}
